package org.bot.plugin.web.event;
import org.bot.api.event.DataStorage;
import org.bot.api.event.EventName;
import org.bot.api.event.Events;
import org.bot.api.flow.FlowNode;
import org.bot.plugin.web.util.WebApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author 沧月
 * @create 0014 2023/9/14 10:44
 * @description <切换tab页>
 */
@Component
@EventName("切换tab页")
public class WebSwitchPage implements Events {

    @Autowired
    WebApi webApi;

    @Override
    public Object exec(FlowNode note, DataStorage data) {
        webApi.switchPage(webApi.getWebDriver(note), Integer.parseInt(note.getArg()));
        return null;
    }

}
